<?php
//-------------------------------------------------------------------------------------------------------
    require_once($config['app_dir'] . '/includes/template.class.php');
    //---------------------------------------------------------------------------------------------------
    class objCurrencyServer {
            protected $_data = false;
            protected $_sql_querys = array();

        public function __construct() {
            $this->_sqls();
        }//constructor

        protected function Prepare() {
            $this->_data = objDataBase::GetInstance()->handler->GetAll($this->_sql_querys['list']);
            return !empty($this->_data) && $this->_data;
        } //Prepare

        public function Render() {
            if( !$this->Prepare() ) return false;

            $Rates = new objTemplate();
            $Rates->Assign('data', $this->_data);
            return $Rates->Fetch('_CurrencyItems.tpl');
        } //Render

        protected function _sqls() {
            $this->_sql_querys['list'] =
               "SELECT * FROM fa_currency c ORDER BY c.Country";
         } //_sqls

    } //class objCurrencyServer

    //---------------------------------------------------------------------------------------------------

    function showCurrency() {
        $CurrencyServer = new objCurrencyServer();
        //----------------------------------------------------------------------
        $objResponse = new xajaxResponse();
        $objResponse->addAssign("divCurrency","innerHTML", $CurrencyServer->Render());
        //----------------------------------------------------------------------
        return $objResponse;
    }//showCurrency
//-------------------------------------------------------------------------------------------------------
?>
